package t10086.Tookit;

import java.util.Locale;
import java.util.Random;
import net.datafaker.Faker;

public class StrUtil {
    private Faker faker;
    public StrUtil() {
        faker = new Faker(Locale.CHINA);
    }
    public String generateName(){
        return faker.name().name();
    }
    public String generateRandomNumberString(int n) {
        if (n <= 0) {
            throw new IllegalArgumentException("Number of digits must be positive.");
        }

        Random random = new Random();
        int lowerBound = (int) Math.pow(10, n - 1); // 最小的 n 位数
        int upperBound = (int) Math.pow(10, n) - 1; // 最大的 n 位数

        int randomNumber = random.nextInt(upperBound - lowerBound + 1) + lowerBound;

        return String.valueOf(randomNumber); // 转换为字符串
    }
    public static void main(String[] args) {
        System.out.println(new StrUtil().generateName());
    }

}
